/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wbd_au;

import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JSpinner;
import wbd_au.browsers.WybierzJDialog;
import wbd_au.objects_mappings.Cwiczenia;
import wbd_au.objects_mappings.ObiektCwiczebny;
import wbd_au.objects_mappings.Oddzial;
import wbd_au.objects_mappings.Zolnierz;

/**
 *
 * @author Gospo
 */
public class ManagementJPanel extends javax.swing.JPanel {

    MainJFrame frame;

    /**
     * Creates new form AdminJPanel
     */
    public ManagementJPanel(MainJFrame frame) {
        this.frame = frame;
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        managementJTabbedPane = new javax.swing.JTabbedPane();
        zolnierzeJPanel = new javax.swing.JPanel();
        zolnierzeImieJTextField = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        zolnierzeNazwiskoJTextField = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        zolnierzePeselJTextField = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        zolnierzeNrTelefonuJTextField = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        zolnierzeMiastoJTextField = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        zolnierzeUlicaJTextField = new javax.swing.JTextField();
        zolnierzeKodPocztowyJTextField = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        zolnierzeNrDomuJTextField = new javax.swing.JTextField();
        zolnierzeNrMieszkaniaJTextField = new javax.swing.JTextField();
        zolnierzeEmailJTextField = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        zolnierzeDodajJButton = new javax.swing.JButton();
        zolnierzePodgladJButton = new javax.swing.JButton();
        jLabel48 = new javax.swing.JLabel();
        jSeparator4 = new javax.swing.JSeparator();
        jLabel49 = new javax.swing.JLabel();
        zolnierzeIdOddzialJText = new javax.swing.JTextField();
        zolnierzeWybierzOddzialJButton = new javax.swing.JButton();
        jLabel35 = new javax.swing.JLabel();
        jSeparator6 = new javax.swing.JSeparator();
        zolnierzeUsunJButton = new javax.swing.JButton();
        zolnierzeWybierzZolnierzaJButton1 = new javax.swing.JButton();
        zolnierzeIdZolnierzaJTextField = new javax.swing.JTextField();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        cwiczeniaJPanel = new javax.swing.JPanel();
        cwiczeniaIdObiektTextField = new javax.swing.JTextField();
        cwiczeniaIdOddzialJText = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        cwiczeniaWybierzObiektCwiczebnyJButton = new javax.swing.JButton();
        cwiczeniaWybierzOddzialJButton = new javax.swing.JButton();
        cwiczeniaOdKiedyJSpinner = new javax.swing.JSpinner();
        cwiczeniaDoKiedyJSpinner = new javax.swing.JSpinner();
        cwiczeniaDodajJButton = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        cwiczeniaPodgladJButton = new javax.swing.JButton();
        jSeparator7 = new javax.swing.JSeparator();
        oddzialyUsunJButton1 = new javax.swing.JButton();
        oddzialyWybierzOddzialJButton1 = new javax.swing.JButton();
        oddzialyIdOddzialuJTextField1 = new javax.swing.JTextField();
        jLabel54 = new javax.swing.JLabel();
        jLabel55 = new javax.swing.JLabel();
        oddzialyJPanel = new javax.swing.JPanel();
        jLabel24 = new javax.swing.JLabel();
        oddzialyNazwaOddzialuJTextField = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        oddzialyDodajJButton = new javax.swing.JButton();
        jLabel41 = new javax.swing.JLabel();
        podgladJButton1 = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel42 = new javax.swing.JLabel();
        oddzialySpecjalizacjaJComboBox = new javax.swing.JComboBox();
        jSeparator5 = new javax.swing.JSeparator();
        jLabel50 = new javax.swing.JLabel();
        oddzialyIdOddzialuJTextField = new javax.swing.JTextField();
        oddzialyWybierzOddzialJButton = new javax.swing.JButton();
        jLabel51 = new javax.swing.JLabel();
        oddzialyUsunJButton = new javax.swing.JButton();
        obiektCwiczebnyJPanel = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        ObiektyCwiczebnePodgladJButton = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel43 = new javax.swing.JLabel();
        ObiektyCwiczebneNazwaJTextField = new javax.swing.JTextField();
        jLabel44 = new javax.swing.JLabel();
        ObiektyCwiczebneTypJComboBox = new javax.swing.JComboBox();
        ObiektyCwiczebneUwagiJTextField = new javax.swing.JTextField();
        ObiektyCwiczebneDlaIluZolnierzyJTextField = new javax.swing.JTextField();
        jLabel45 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        ObiektyCwiczebneDodajJButton = new javax.swing.JButton();
        jSeparator8 = new javax.swing.JSeparator();
        obiektyUsunJButton = new javax.swing.JButton();
        obiektyWybierzObiektJButton = new javax.swing.JButton();
        obiektyIdObiektuJTextField = new javax.swing.JTextField();
        jLabel56 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        kwateryJPanel = new javax.swing.JPanel();
        miastoJTextField = new javax.swing.JTextField();
        ulicaJTextField = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        nrDomuJTextField = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        nrMieszkaniaJTextField = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        metrarzJTextField = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        liczbaPokoiJTextField = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        iluOsobowaJTextField = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        idKwateraJTextField = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        kodPocztowyJSpinner = new javax.swing.JSpinner();
        posilkiJPanel = new javax.swing.JPanel();
        przepustkiJPanel = new javax.swing.JPanel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jTextField25 = new javax.swing.JTextField();
        jTextField26 = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jTextField27 = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        jTextField29 = new javax.swing.JTextField();
        jButton7 = new javax.swing.JButton();
        sprzetJPanel = new javax.swing.JPanel();
        wartaJPanel = new javax.swing.JPanel();
        zoldJPanel = new javax.swing.JPanel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jTextField31 = new javax.swing.JTextField();
        jTextField32 = new javax.swing.JTextField();
        jButton8 = new javax.swing.JButton();
        jTextField33 = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jTextField13 = new javax.swing.JTextField();
        jTextField14 = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane1.setViewportView(jTextArea1);

        jLabel1.setText("Imię");

        jLabel2.setText("Nazwisko");

        jLabel3.setText("Pesel");

        jLabel4.setText("Nr telefonu");

        jLabel5.setText("Miasto");

        zolnierzeUlicaJTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                zolnierzeUlicaJTextFieldActionPerformed(evt);
            }
        });

        jLabel6.setText("Ulica");

        jLabel7.setText("Kod Pocztowy");

        jLabel8.setText("Nr domu");

        jLabel9.setText("Nr mieszkania");

        jLabel10.setText("e-mail");

        zolnierzeDodajJButton.setText("Dodaj");
        zolnierzeDodajJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                zolnierzeDodajJButtonActionPerformed(evt);
            }
        });

        zolnierzePodgladJButton.setText("Podgląd");
        zolnierzePodgladJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                zolnierzePodgladJButtonActionPerformed(evt);
            }
        });

        jLabel48.setText("Podgląd Żołnierzy");

        jLabel49.setText("Dodaj Żołnierza");

        zolnierzeWybierzOddzialJButton.setText("wybierz oddział");
        zolnierzeWybierzOddzialJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                zolnierzeWybierzOddzialJButtonActionPerformed(evt);
            }
        });

        jLabel35.setText("id oddziału");

        zolnierzeUsunJButton.setText("Usuń");
        zolnierzeUsunJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                zolnierzeUsunJButtonActionPerformed(evt);
            }
        });

        zolnierzeWybierzZolnierzaJButton1.setText("wybierz żołnierza");
        zolnierzeWybierzZolnierzaJButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                zolnierzeWybierzZolnierzaJButton1ActionPerformed(evt);
            }
        });

        jLabel52.setText("id żołnierza");

        jLabel53.setText("Usuń Żołnierza");

        javax.swing.GroupLayout zolnierzeJPanelLayout = new javax.swing.GroupLayout(zolnierzeJPanel);
        zolnierzeJPanel.setLayout(zolnierzeJPanelLayout);
        zolnierzeJPanelLayout.setHorizontalGroup(
            zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator4)
                    .addComponent(jSeparator6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 580, Short.MAX_VALUE)
                    .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel48)
                                .addGap(18, 18, 18)
                                .addComponent(zolnierzePodgladJButton))
                            .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                                .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                                        .addComponent(jLabel49)
                                        .addGap(18, 18, 18)
                                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel1)
                                            .addComponent(jLabel2)
                                            .addComponent(jLabel3)
                                            .addComponent(jLabel4)
                                            .addComponent(jLabel5)
                                            .addComponent(jLabel6)
                                            .addComponent(jLabel7)
                                            .addComponent(jLabel8)
                                            .addComponent(jLabel9)
                                            .addComponent(jLabel10)))
                                    .addComponent(jLabel35))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(zolnierzeIdOddzialJText)
                                    .addComponent(zolnierzeDodajJButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(zolnierzeNrMieszkaniaJTextField, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(zolnierzeNrDomuJTextField)
                                    .addComponent(zolnierzeKodPocztowyJTextField)
                                    .addComponent(zolnierzeUlicaJTextField)
                                    .addComponent(zolnierzeMiastoJTextField)
                                    .addComponent(zolnierzeNrTelefonuJTextField)
                                    .addComponent(zolnierzePeselJTextField)
                                    .addComponent(zolnierzeNazwiskoJTextField)
                                    .addComponent(zolnierzeImieJTextField)
                                    .addComponent(zolnierzeEmailJTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                                .addGap(18, 18, 18)
                                .addComponent(zolnierzeWybierzOddzialJButton))
                            .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel53)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel52)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(zolnierzeUsunJButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(zolnierzeIdZolnierzaJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(zolnierzeWybierzZolnierzaJButton1)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        zolnierzeJPanelLayout.setVerticalGroup(
            zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, zolnierzeJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel48)
                    .addComponent(zolnierzePodgladJButton))
                .addGap(18, 18, 18)
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel49))
                    .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeImieJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeNazwiskoJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzePeselJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeNrTelefonuJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeMiastoJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeUlicaJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeKodPocztowyJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeNrDomuJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeNrMieszkaniaJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeEmailJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(zolnierzeIdOddzialJText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(zolnierzeWybierzOddzialJButton)
                    .addComponent(jLabel35))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(zolnierzeDodajJButton)
                .addGap(18, 18, 18)
                .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel53)
                    .addGroup(zolnierzeJPanelLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addGroup(zolnierzeJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(zolnierzeIdZolnierzaJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(zolnierzeWybierzZolnierzaJButton1)
                            .addComponent(jLabel52))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(zolnierzeUsunJButton)))
                .addContainerGap(25, Short.MAX_VALUE))
        );

        managementJTabbedPane.addTab("Żołnierze", zolnierzeJPanel);

        cwiczeniaIdOddzialJText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cwiczeniaIdOddzialJTextActionPerformed(evt);
            }
        });

        jLabel11.setText("id obiektu ćwiczebnego");

        jLabel12.setText("id oddziału");

        jLabel13.setText("od kiedy");

        jLabel14.setText("do kiedy");

        cwiczeniaWybierzObiektCwiczebnyJButton.setText("wybierz obiekt ćwiczebny");
        cwiczeniaWybierzObiektCwiczebnyJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cwiczeniaWybierzObiektCwiczebnyJButtonActionPerformed(evt);
            }
        });

        cwiczeniaWybierzOddzialJButton.setText("wybierz oddział");
        cwiczeniaWybierzOddzialJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cwiczeniaWybierzOddzialJButtonActionPerformed(evt);
            }
        });

        cwiczeniaOdKiedyJSpinner.setModel(new javax.swing.SpinnerDateModel());
        cwiczeniaOdKiedyJSpinner.setEditor(new JSpinner.DateEditor(cwiczeniaOdKiedyJSpinner, Consts.dateFormat));

        cwiczeniaDoKiedyJSpinner.setModel(new javax.swing.SpinnerDateModel());
        cwiczeniaDoKiedyJSpinner.setEditor(new JSpinner.DateEditor(cwiczeniaDoKiedyJSpinner, Consts.dateFormat));

        cwiczeniaDodajJButton.setText("Dodaj");
        cwiczeniaDodajJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cwiczeniaDodajJButtonActionPerformed(evt);
            }
        });

        jLabel39.setText("Dodaj Ćwiczenie");

        jLabel40.setText("Podgląd Ćwiczeń");

        cwiczeniaPodgladJButton.setText("Podgląd");
        cwiczeniaPodgladJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cwiczeniaPodgladJButtonActionPerformed(evt);
            }
        });

        oddzialyUsunJButton1.setText("Usuń");
        oddzialyUsunJButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oddzialyUsunJButton1ActionPerformed(evt);
            }
        });

        oddzialyWybierzOddzialJButton1.setText("wybierz oddział");
        oddzialyWybierzOddzialJButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oddzialyWybierzOddzialJButton1ActionPerformed(evt);
            }
        });

        jLabel54.setText("id oddziału");

        jLabel55.setText("Usuń Oddział");

        javax.swing.GroupLayout cwiczeniaJPanelLayout = new javax.swing.GroupLayout(cwiczeniaJPanel);
        cwiczeniaJPanel.setLayout(cwiczeniaJPanelLayout);
        cwiczeniaJPanelLayout.setHorizontalGroup(
            cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1)
                    .addComponent(jSeparator7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 580, Short.MAX_VALUE)
                    .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                        .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel40)
                                .addGap(18, 18, 18)
                                .addComponent(cwiczeniaPodgladJButton))
                            .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel39)
                                .addGap(18, 18, 18)
                                .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel12)
                                    .addComponent(jLabel13)
                                    .addComponent(jLabel14)
                                    .addComponent(jLabel11))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(cwiczeniaOdKiedyJSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(cwiczeniaDoKiedyJSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                                            .addComponent(cwiczeniaIdObiektTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(cwiczeniaWybierzObiektCwiczebnyJButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                                            .addComponent(cwiczeniaIdOddzialJText, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(cwiczeniaWybierzOddzialJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addComponent(cwiczeniaDodajJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel55)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel54)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(oddzialyUsunJButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(oddzialyIdOddzialuJTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(oddzialyWybierzOddzialJButton1)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        cwiczeniaJPanelLayout.setVerticalGroup(
            cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel40)
                    .addComponent(cwiczeniaPodgladJButton))
                .addGap(18, 18, 18)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel39))
                    .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cwiczeniaIdObiektTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11)
                            .addComponent(cwiczeniaWybierzObiektCwiczebnyJButton))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cwiczeniaIdOddzialJText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel12)
                            .addComponent(cwiczeniaWybierzOddzialJButton))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel13)
                            .addComponent(cwiczeniaOdKiedyJSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(2, 2, 2)
                        .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(cwiczeniaDoKiedyJSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cwiczeniaDodajJButton)))
                .addGap(18, 18, 18)
                .addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel55)
                    .addGroup(cwiczeniaJPanelLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addGroup(cwiczeniaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(oddzialyIdOddzialuJTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(oddzialyWybierzOddzialJButton1)
                            .addComponent(jLabel54))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(oddzialyUsunJButton1)))
                .addContainerGap(206, Short.MAX_VALUE))
        );

        managementJTabbedPane.addTab("Ćwiczenia", cwiczeniaJPanel);

        jLabel24.setText("Nazwa oddzialu");

        jLabel33.setText("Specjalizacja");

        oddzialyDodajJButton.setText("Dodaj");
        oddzialyDodajJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oddzialyDodajJButtonActionPerformed(evt);
            }
        });

        jLabel41.setText("Podgląd Oddziałów");

        podgladJButton1.setText("Podgląd");
        podgladJButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                podgladJButton1ActionPerformed(evt);
            }
        });

        jLabel42.setText("Dodaj Oddział");

        oddzialySpecjalizacjaJComboBox.setModel(new DefaultComboBoxModel(Consts.OddzialSpecjalizacjaVal.values()));
        oddzialySpecjalizacjaJComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oddzialySpecjalizacjaJComboBoxActionPerformed(evt);
            }
        });

        jLabel50.setText("Usuń Oddział");

        oddzialyWybierzOddzialJButton.setText("wybierz oddział");
        oddzialyWybierzOddzialJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oddzialyWybierzOddzialJButtonActionPerformed(evt);
            }
        });

        jLabel51.setText("id oddziału");

        oddzialyUsunJButton.setText("Usuń");
        oddzialyUsunJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oddzialyUsunJButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout oddzialyJPanelLayout = new javax.swing.GroupLayout(oddzialyJPanel);
        oddzialyJPanel.setLayout(oddzialyJPanelLayout);
        oddzialyJPanelLayout.setHorizontalGroup(
            oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator2)
                    .addComponent(jSeparator5, javax.swing.GroupLayout.DEFAULT_SIZE, 580, Short.MAX_VALUE)
                    .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                        .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel41)
                                .addGap(18, 18, 18)
                                .addComponent(podgladJButton1))
                            .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel42)
                                .addGap(18, 18, 18)
                                .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel24)
                                    .addComponent(jLabel33, javax.swing.GroupLayout.Alignment.TRAILING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(oddzialyDodajJButton, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                                    .addComponent(oddzialySpecjalizacjaJComboBox, 0, 80, Short.MAX_VALUE)
                                    .addComponent(oddzialyNazwaOddzialuJTextField)))
                            .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel50)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel51)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(oddzialyUsunJButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(oddzialyIdOddzialuJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(oddzialyWybierzOddzialJButton)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        oddzialyJPanelLayout.setVerticalGroup(
            oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel41)
                    .addComponent(podgladJButton1))
                .addGap(18, 18, 18)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel42))
                    .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(oddzialyNazwaOddzialuJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel33, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(oddzialySpecjalizacjaJComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(oddzialyDodajJButton)
                .addGap(18, 18, 18)
                .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel50))
                    .addGroup(oddzialyJPanelLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(oddzialyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(oddzialyIdOddzialuJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(oddzialyWybierzOddzialJButton)
                            .addComponent(jLabel51))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(oddzialyUsunJButton)))
                .addContainerGap(255, Short.MAX_VALUE))
        );

        managementJTabbedPane.addTab("Oddziały", oddzialyJPanel);

        jLabel23.setText("Podgląd Obiektów");

        ObiektyCwiczebnePodgladJButton.setText("Podgląd");
        ObiektyCwiczebnePodgladJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ObiektyCwiczebnePodgladJButtonActionPerformed(evt);
            }
        });

        jLabel43.setText("Dodaj Obiekt");

        jLabel44.setText("Nazwa");

        ObiektyCwiczebneTypJComboBox.setModel(new DefaultComboBoxModel(Consts.ObiektCwiczebnyTypVal.values()));

        ObiektyCwiczebneUwagiJTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ObiektyCwiczebneUwagiJTextFieldActionPerformed(evt);
            }
        });

        jLabel45.setText("Typ");

        jLabel46.setText("Uwagi");

        jLabel47.setText("Dla ilu żołnierzy");

        ObiektyCwiczebneDodajJButton.setText("Dodaj");
        ObiektyCwiczebneDodajJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ObiektyCwiczebneDodajJButtonActionPerformed(evt);
            }
        });

        obiektyUsunJButton.setText("Usuń");
        obiektyUsunJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                obiektyUsunJButtonActionPerformed(evt);
            }
        });

        obiektyWybierzObiektJButton.setText("wybierz obiekt");
        obiektyWybierzObiektJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                obiektyWybierzObiektJButtonActionPerformed(evt);
            }
        });

        jLabel56.setText("id obiektu");

        jLabel57.setText("Usuń Obiekt");

        javax.swing.GroupLayout obiektCwiczebnyJPanelLayout = new javax.swing.GroupLayout(obiektCwiczebnyJPanel);
        obiektCwiczebnyJPanel.setLayout(obiektCwiczebnyJPanelLayout);
        obiektCwiczebnyJPanelLayout.setHorizontalGroup(
            obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                        .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel23)
                                .addGap(18, 18, 18)
                                .addComponent(ObiektyCwiczebnePodgladJButton))
                            .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                                .addComponent(jLabel43)
                                .addGap(18, 18, 18)
                                .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel44)
                                    .addComponent(jLabel45)
                                    .addComponent(jLabel46)
                                    .addComponent(jLabel47))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(ObiektyCwiczebneDodajJButton, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                                    .addComponent(ObiektyCwiczebneNazwaJTextField)
                                    .addComponent(ObiektyCwiczebneTypJComboBox, 0, 100, Short.MAX_VALUE)
                                    .addComponent(ObiektyCwiczebneUwagiJTextField)
                                    .addComponent(ObiektyCwiczebneDlaIluZolnierzyJTextField))))
                        .addGap(326, 326, 326))
                    .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                        .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jSeparator3)
                            .addComponent(jSeparator8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 580, Short.MAX_VALUE))
                        .addContainerGap())
                    .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                        .addComponent(jLabel57)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel56)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(obiektyUsunJButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(obiektyIdObiektuJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(obiektyWybierzObiektJButton)
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        obiektCwiczebnyJPanelLayout.setVerticalGroup(
            obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(ObiektyCwiczebnePodgladJButton))
                .addGap(18, 18, 18)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel43))
                    .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ObiektyCwiczebneNazwaJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel44))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ObiektyCwiczebneTypJComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel45))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ObiektyCwiczebneUwagiJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel46))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel47)
                            .addComponent(ObiektyCwiczebneDlaIluZolnierzyJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ObiektyCwiczebneDodajJButton)
                .addGap(18, 18, 18)
                .addComponent(jSeparator8, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel57)
                    .addGroup(obiektCwiczebnyJPanelLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addGroup(obiektCwiczebnyJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(obiektyIdObiektuJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(obiektyWybierzObiektJButton)
                            .addComponent(jLabel56))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(obiektyUsunJButton)))
                .addContainerGap(208, Short.MAX_VALUE))
        );

        managementJTabbedPane.addTab("Obiekty Ćwiczebne", obiektCwiczebnyJPanel);

        jLabel15.setText("Miasto");
        jLabel15.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel15.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        jLabel16.setText("Ulica");
        jLabel16.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel16.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

        jLabel17.setText("Nr domu");
        jLabel17.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel17.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

        nrDomuJTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nrDomuJTextFieldActionPerformed(evt);
            }
        });

        jLabel18.setText("Nr mieszkania");
        jLabel18.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel18.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

        nrMieszkaniaJTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nrMieszkaniaJTextFieldActionPerformed(evt);
            }
        });

        jLabel19.setText("Kod pocztowy");
        jLabel19.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel19.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

        jLabel20.setText("Metrarz");
        jLabel20.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel20.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

        jLabel21.setText("Liczba pokoi");
        jLabel21.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel21.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

        jLabel22.setText("Ilu osobowa");
        jLabel22.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel22.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

        jButton3.setText("Dodaj kwaterę do bazy");

        jLabel28.setText("id kwatery");

        kodPocztowyJSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 99999, 1));

        javax.swing.GroupLayout kwateryJPanelLayout = new javax.swing.GroupLayout(kwateryJPanel);
        kwateryJPanel.setLayout(kwateryJPanelLayout);
        kwateryJPanelLayout.setHorizontalGroup(
            kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(kwateryJPanelLayout.createSequentialGroup()
                .addGap(62, 62, 62)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel28, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel16, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel17, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel21, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel22, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(kwateryJPanelLayout.createSequentialGroup()
                        .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(idKwateraJTextField)
                            .addComponent(miastoJTextField)
                            .addComponent(ulicaJTextField)
                            .addComponent(nrDomuJTextField)
                            .addComponent(nrMieszkaniaJTextField)
                            .addComponent(metrarzJTextField)
                            .addComponent(liczbaPokoiJTextField)
                            .addComponent(iluOsobowaJTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
                        .addGap(49, 49, 49)
                        .addComponent(jButton3))
                    .addComponent(kodPocztowyJSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(158, Short.MAX_VALUE))
        );
        kwateryJPanelLayout.setVerticalGroup(
            kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(kwateryJPanelLayout.createSequentialGroup()
                .addContainerGap(70, Short.MAX_VALUE)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(idKwateraJTextField)
                    .addComponent(jLabel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(miastoJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ulicaJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(nrDomuJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(nrMieszkaniaJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(kwateryJPanelLayout.createSequentialGroup()
                        .addGap(16, 16, 16)
                        .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(kwateryJPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(kodPocztowyJSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(metrarzJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(liczbaPokoiJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(kwateryJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton3))
                    .addComponent(iluOsobowaJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(162, Short.MAX_VALUE))
        );

        managementJTabbedPane.addTab("Kwatery", kwateryJPanel);

        javax.swing.GroupLayout posilkiJPanelLayout = new javax.swing.GroupLayout(posilkiJPanel);
        posilkiJPanel.setLayout(posilkiJPanelLayout);
        posilkiJPanelLayout.setHorizontalGroup(
            posilkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 600, Short.MAX_VALUE)
        );
        posilkiJPanelLayout.setVerticalGroup(
            posilkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 512, Short.MAX_VALUE)
        );

        managementJTabbedPane.addTab("Posiłki", posilkiJPanel);

        jLabel25.setText("Data rozpoczęcia");

        jLabel26.setText("Data zakończenia");

        jLabel27.setText("Powód");

        jLabel34.setText("id zolnierza");

        jButton7.setText("Wybierz zolnierza");

        javax.swing.GroupLayout przepustkiJPanelLayout = new javax.swing.GroupLayout(przepustkiJPanel);
        przepustkiJPanel.setLayout(przepustkiJPanelLayout);
        przepustkiJPanelLayout.setHorizontalGroup(
            przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(przepustkiJPanelLayout.createSequentialGroup()
                .addGap(68, 68, 68)
                .addGroup(przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(przepustkiJPanelLayout.createSequentialGroup()
                        .addGap(31, 31, 31)
                        .addComponent(jLabel34)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextField29))
                    .addGroup(przepustkiJPanelLayout.createSequentialGroup()
                        .addGroup(przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel25)
                            .addComponent(jLabel26)
                            .addComponent(jLabel27))
                        .addGroup(przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(przepustkiJPanelLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(przepustkiJPanelLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jTextField26))
                            .addGroup(przepustkiJPanelLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jTextField27)))))
                .addGap(18, 18, 18)
                .addComponent(jButton7)
                .addContainerGap(187, Short.MAX_VALUE))
        );
        przepustkiJPanelLayout.setVerticalGroup(
            przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(przepustkiJPanelLayout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel34, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(przepustkiJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(368, Short.MAX_VALUE))
        );

        managementJTabbedPane.addTab("Przepustki", przepustkiJPanel);

        javax.swing.GroupLayout sprzetJPanelLayout = new javax.swing.GroupLayout(sprzetJPanel);
        sprzetJPanel.setLayout(sprzetJPanelLayout);
        sprzetJPanelLayout.setHorizontalGroup(
            sprzetJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 600, Short.MAX_VALUE)
        );
        sprzetJPanelLayout.setVerticalGroup(
            sprzetJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 512, Short.MAX_VALUE)
        );

        managementJTabbedPane.addTab("Sprzęt", sprzetJPanel);

        javax.swing.GroupLayout wartaJPanelLayout = new javax.swing.GroupLayout(wartaJPanel);
        wartaJPanel.setLayout(wartaJPanelLayout);
        wartaJPanelLayout.setHorizontalGroup(
            wartaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 600, Short.MAX_VALUE)
        );
        wartaJPanelLayout.setVerticalGroup(
            wartaJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 512, Short.MAX_VALUE)
        );

        managementJTabbedPane.addTab("Warta", wartaJPanel);

        jLabel36.setText("id zolnierza");

        jLabel37.setText("Kwota");

        jLabel38.setText("Data otrzymania odstatniej wypłaty");

        jButton8.setText("Wybierz zolnierza");

        javax.swing.GroupLayout zoldJPanelLayout = new javax.swing.GroupLayout(zoldJPanel);
        zoldJPanel.setLayout(zoldJPanelLayout);
        zoldJPanelLayout.setHorizontalGroup(
            zoldJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(zoldJPanelLayout.createSequentialGroup()
                .addGap(109, 109, 109)
                .addGroup(zoldJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel38)
                    .addComponent(jLabel36, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel37, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(zoldJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextField31)
                    .addComponent(jTextField32)
                    .addComponent(jTextField33, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(jButton8)
                .addContainerGap(81, Short.MAX_VALUE))
        );
        zoldJPanelLayout.setVerticalGroup(
            zoldJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(zoldJPanelLayout.createSequentialGroup()
                .addGap(38, 38, 38)
                .addGroup(zoldJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel36, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(zoldJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel37, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(zoldJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(395, Short.MAX_VALUE))
        );

        managementJTabbedPane.addTab("Żołd", zoldJPanel);

        jLabel29.setText("id kwatery");

        jLabel30.setText("id zolnierza");

        jLabel31.setText("od kiedy");

        jLabel32.setText("do kiedy");

        jButton4.setText("Wybierz żołnierza");

        jButton5.setText("Wybierz kwaterę");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(174, 174, 174)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel31, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel29, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel30, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel32, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextField13)
                    .addComponent(jTextField14, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                    .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(115, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton5))
                    .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(362, Short.MAX_VALUE))
        );

        managementJTabbedPane.addTab("Przydział_Kwatery", jPanel1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(managementJTabbedPane)
                .addGap(64, 64, 64))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(managementJTabbedPane)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void zolnierzeUlicaJTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zolnierzeUlicaJTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_zolnierzeUlicaJTextFieldActionPerformed

    private void zolnierzeDodajJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zolnierzeDodajJButtonActionPerformed
        try {
            String tableName = "ZOLNIERZ";

            String idZolnierz = Consts.ZolnierzNextSeqVal;
            String imie = zolnierzeImieJTextField.getText();
            String nazwisko = zolnierzeNazwiskoJTextField.getText();
            String pesel = zolnierzePeselJTextField.getText();
            String nrTelefonu = zolnierzeNrTelefonuJTextField.getText();
            String miasto = zolnierzeMiastoJTextField.getText();
            String ulica = zolnierzeUlicaJTextField.getText();
            String kodPocztowy = zolnierzeKodPocztowyJTextField.getText();
            String nrDomu = zolnierzeNrDomuJTextField.getText();
            String nrMieszkania = zolnierzeNrMieszkaniaJTextField.getText();
            String email = zolnierzeEmailJTextField.getText();
            String idOddzial = zolnierzeIdOddzialJText.getText();

            String query = buildInsertQuery(tableName, idZolnierz, imie, nazwisko, pesel, nrTelefonu, miasto, ulica, kodPocztowy, nrDomu, nrMieszkania, email, idOddzial);
            Statement stmt = DBManager.con.createStatement();
            stmt.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(ManagementJPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_zolnierzeDodajJButtonActionPerformed

    private void cwiczeniaWybierzObiektCwiczebnyJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cwiczeniaWybierzObiektCwiczebnyJButtonActionPerformed
        WybierzJDialog dialog = Utils.getObiektCwiczebnyWybierzJDialog(frame, cwiczeniaIdObiektTextField);
        dialog.setVisible(true);
    }//GEN-LAST:event_cwiczeniaWybierzObiektCwiczebnyJButtonActionPerformed

    private void cwiczeniaIdOddzialJTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cwiczeniaIdOddzialJTextActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cwiczeniaIdOddzialJTextActionPerformed

    private void nrDomuJTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nrDomuJTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_nrDomuJTextFieldActionPerformed

    private void cwiczeniaWybierzOddzialJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cwiczeniaWybierzOddzialJButtonActionPerformed
        WybierzJDialog dialog = Utils.getOddzialWybierzJDialog(frame, cwiczeniaIdOddzialJText);
        dialog.setVisible(true);
    }//GEN-LAST:event_cwiczeniaWybierzOddzialJButtonActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton5ActionPerformed

    private void nrMieszkaniaJTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nrMieszkaniaJTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_nrMieszkaniaJTextFieldActionPerformed

    private String buildInsertQuery(String tableName, Object... values) {
        StringBuilder builder = new StringBuilder();

        builder.append(values[0]);
        for (int i = 1; i < values.length; i++) {
            if (values[i] instanceof Date) {
                Date date = (Date) values[i];
                i++;
                String format = (String) values[i];
                String dbDate = new SimpleDateFormat(format).format(date);
                String dbFormat = format.replace("m", "MI");
                builder.append(", to_date('" + dbDate + "', '" + dbFormat + "')");
            } else {
                builder.append(", '" + values[i] + "'");
            }
        }

        String query = "insert into " + tableName
                + " Values (" + builder.toString() + ")";

        return query;
    }

    private void cwiczeniaDodajJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cwiczeniaDodajJButtonActionPerformed
        try {
            String tableName = "CWICZENIA";

            String idObiektu = cwiczeniaIdObiektTextField.getText();
            String idOddzialu = cwiczeniaIdOddzialJText.getText();
            Date data_od = (Date) cwiczeniaOdKiedyJSpinner.getValue();
            Date data_do = (Date) cwiczeniaDoKiedyJSpinner.getValue();
            String query = buildInsertQuery(tableName, idObiektu, idOddzialu, data_od, Consts.dateFormat, data_do, Consts.dateFormat);
            Statement stmt = DBManager.con.createStatement();
            stmt.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(ManagementJPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_cwiczeniaDodajJButtonActionPerformed

    private void cwiczeniaPodgladJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cwiczeniaPodgladJButtonActionPerformed
        WybierzJDialog dialog = Utils.getCwiczeniaWybierzJDialog(frame, null);
        dialog.setVisible(true);
    }//GEN-LAST:event_cwiczeniaPodgladJButtonActionPerformed

    private void podgladJButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_podgladJButton1ActionPerformed
        WybierzJDialog dialog = Utils.getOddzialWybierzJDialog(frame, null);
        dialog.setVisible(true);
    }//GEN-LAST:event_podgladJButton1ActionPerformed
    private void oddzialyDodajJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oddzialyDodajJButtonActionPerformed
        try {
            String tableName = "ODDZIAL";

            String idOddzialu = Consts.OddzialNextSeqVal;
            String nazwaOddzialu = oddzialyNazwaOddzialuJTextField.getText();
            String specjalizacja = oddzialySpecjalizacjaJComboBox.getSelectedItem().toString();
            String query = buildInsertQuery(tableName, idOddzialu, nazwaOddzialu, specjalizacja);
            Statement stmt = DBManager.con.createStatement();
            stmt.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(ManagementJPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_oddzialyDodajJButtonActionPerformed

    private void oddzialySpecjalizacjaJComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oddzialySpecjalizacjaJComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_oddzialySpecjalizacjaJComboBoxActionPerformed

    private void ObiektyCwiczebneUwagiJTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ObiektyCwiczebneUwagiJTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ObiektyCwiczebneUwagiJTextFieldActionPerformed

    private void ObiektyCwiczebnePodgladJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ObiektyCwiczebnePodgladJButtonActionPerformed
        WybierzJDialog dialog = Utils.getObiektCwiczebnyWybierzJDialog(frame, null);
        dialog.setVisible(true);
    }//GEN-LAST:event_ObiektyCwiczebnePodgladJButtonActionPerformed

    private void ObiektyCwiczebneDodajJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ObiektyCwiczebneDodajJButtonActionPerformed
        try {
            String tableName = "OBIEKT_CWICZEBNY";

            String idObiekt = Consts.ObiektCwiczebnyNextSeqVal;
            String nazwaObiektu = ObiektyCwiczebneNazwaJTextField.getText();
            String typ = ObiektyCwiczebneTypJComboBox.getSelectedItem().toString();
            String uwagi = ObiektyCwiczebneUwagiJTextField.getText();
            String dlaIluZolnierzy = ObiektyCwiczebneDlaIluZolnierzyJTextField.getText();

            String query = buildInsertQuery(tableName, idObiekt, nazwaObiektu, typ, uwagi, dlaIluZolnierzy);
            Statement stmt = DBManager.con.createStatement();
            stmt.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(ManagementJPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_ObiektyCwiczebneDodajJButtonActionPerformed

    private void zolnierzePodgladJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zolnierzePodgladJButtonActionPerformed
        WybierzJDialog dialog = Utils.getZolnierzWybierzJDialog(frame, null);
        dialog.setVisible(true);
    }//GEN-LAST:event_zolnierzePodgladJButtonActionPerformed

    private void oddzialyWybierzOddzialJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oddzialyWybierzOddzialJButtonActionPerformed
        WybierzJDialog dialog = Utils.getOddzialWybierzJDialog(frame, oddzialyIdOddzialuJTextField);
        dialog.setVisible(true);
    }//GEN-LAST:event_oddzialyWybierzOddzialJButtonActionPerformed

    private String buildDeleteQuery(String tableName, Object... elems) {
        StringBuilder builder = new StringBuilder();

        builder.append(elems[0].toString() + " LIKE " + "'"+elems[1]+"'");
        for (int i = 2; i < elems.length; i+=2) {
            builder.append(" AND ");
            
            if (elems[i+1] instanceof Date) {
                String attribute = elems[i].toString();
                Date date = (Date) elems[i+1];
                String format = (String) elems[i+2];
                String dbDate = new SimpleDateFormat(format).format(date);
                String dbFormat = format.replace("m", "MI");
                builder.append(attribute + " LIKE " + "'%'");//todo
                i++;
            } else {
                builder.append(elems[i].toString() + " LIKE " + "'"+elems[i+1]+"'");
            }
        }

        String query = "delete from " + tableName
                + " where " + builder.toString();

        return query;
    }
    private void oddzialyUsunJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oddzialyUsunJButtonActionPerformed
         try {
            String tableName = "ODDZIAL";

            String idOddzialu = oddzialyIdOddzialuJTextField.getText();
            String query = buildDeleteQuery(tableName, Oddzial.Attribute.ID_ODDZIAL, idOddzialu);
            String clearZolnierzQuery = "update ZOLNIERZ SET " + Zolnierz.Attribute.ID_ODDZIAL.toString()
                    + "=0 where " + Zolnierz.Attribute.ID_ODDZIAL.toString() + "=" + idOddzialu;
            String clearCwiczeniaQuery = buildDeleteQuery("Cwiczenia", Cwiczenia.Attribute.ID_OBIEKT, idOddzialu);
            Statement stmt = DBManager.con.createStatement();
            stmt.executeQuery(clearZolnierzQuery);
            stmt.executeQuery(clearCwiczeniaQuery);
            stmt.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(ManagementJPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_oddzialyUsunJButtonActionPerformed

    private void zolnierzeUsunJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zolnierzeUsunJButtonActionPerformed
        try {
            String tableName = "ZOLNIERZ";

            String idZolnierza = zolnierzeIdZolnierzaJTextField.getText();
            String query = buildDeleteQuery(tableName, Zolnierz.Attribute.ID_ZOLNIERZ, idZolnierza);
            Statement stmt = DBManager.con.createStatement();
            stmt.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(ManagementJPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_zolnierzeUsunJButtonActionPerformed

    private void zolnierzeWybierzZolnierzaJButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zolnierzeWybierzZolnierzaJButton1ActionPerformed
        WybierzJDialog dialog = Utils.getZolnierzWybierzJDialog(frame, zolnierzeIdZolnierzaJTextField);
        dialog.setVisible(true);
    }//GEN-LAST:event_zolnierzeWybierzZolnierzaJButton1ActionPerformed

    private void zolnierzeWybierzOddzialJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zolnierzeWybierzOddzialJButtonActionPerformed
        WybierzJDialog dialog = Utils.getOddzialWybierzJDialog(frame, zolnierzeIdOddzialJText);
        dialog.setVisible(true);
    }//GEN-LAST:event_zolnierzeWybierzOddzialJButtonActionPerformed

    private void oddzialyUsunJButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oddzialyUsunJButton1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_oddzialyUsunJButton1ActionPerformed

    private void oddzialyWybierzOddzialJButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oddzialyWybierzOddzialJButton1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_oddzialyWybierzOddzialJButton1ActionPerformed

    private void obiektyUsunJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_obiektyUsunJButtonActionPerformed
        try {
            String tableName = "OBIEKT_CWICZEBNY";

            String idObiektu = obiektyIdObiektuJTextField.getText();
            String query = buildDeleteQuery(tableName, ObiektCwiczebny.Attribute.ID_OBIEKT, idObiektu);
            String clearCwiczeniaQuery = buildDeleteQuery("Cwiczenia", Cwiczenia.Attribute.ID_OBIEKT, idObiektu);
            Statement stmt = DBManager.con.createStatement();
            stmt.executeQuery(clearCwiczeniaQuery);
            stmt.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(ManagementJPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_obiektyUsunJButtonActionPerformed

    private void obiektyWybierzObiektJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_obiektyWybierzObiektJButtonActionPerformed
        WybierzJDialog dialog = Utils.getObiektCwiczebnyWybierzJDialog(frame, obiektyIdObiektuJTextField);
        dialog.setVisible(true);
    }//GEN-LAST:event_obiektyWybierzObiektJButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField ObiektyCwiczebneDlaIluZolnierzyJTextField;
    private javax.swing.JButton ObiektyCwiczebneDodajJButton;
    private javax.swing.JTextField ObiektyCwiczebneNazwaJTextField;
    private javax.swing.JButton ObiektyCwiczebnePodgladJButton;
    private javax.swing.JComboBox ObiektyCwiczebneTypJComboBox;
    private javax.swing.JTextField ObiektyCwiczebneUwagiJTextField;
    private javax.swing.JSpinner cwiczeniaDoKiedyJSpinner;
    private javax.swing.JButton cwiczeniaDodajJButton;
    private javax.swing.JTextField cwiczeniaIdObiektTextField;
    private javax.swing.JTextField cwiczeniaIdOddzialJText;
    private javax.swing.JPanel cwiczeniaJPanel;
    private javax.swing.JSpinner cwiczeniaOdKiedyJSpinner;
    private javax.swing.JButton cwiczeniaPodgladJButton;
    private javax.swing.JButton cwiczeniaWybierzObiektCwiczebnyJButton;
    private javax.swing.JButton cwiczeniaWybierzOddzialJButton;
    private javax.swing.JTextField idKwateraJTextField;
    private javax.swing.JTextField iluOsobowaJTextField;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JSeparator jSeparator7;
    private javax.swing.JSeparator jSeparator8;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField13;
    private javax.swing.JTextField jTextField14;
    private javax.swing.JTextField jTextField25;
    private javax.swing.JTextField jTextField26;
    private javax.swing.JTextField jTextField27;
    private javax.swing.JTextField jTextField29;
    private javax.swing.JTextField jTextField31;
    private javax.swing.JTextField jTextField32;
    private javax.swing.JTextField jTextField33;
    private javax.swing.JSpinner kodPocztowyJSpinner;
    private javax.swing.JPanel kwateryJPanel;
    private javax.swing.JTextField liczbaPokoiJTextField;
    private javax.swing.JTabbedPane managementJTabbedPane;
    private javax.swing.JTextField metrarzJTextField;
    private javax.swing.JTextField miastoJTextField;
    private javax.swing.JTextField nrDomuJTextField;
    private javax.swing.JTextField nrMieszkaniaJTextField;
    private javax.swing.JPanel obiektCwiczebnyJPanel;
    private javax.swing.JTextField obiektyIdObiektuJTextField;
    private javax.swing.JButton obiektyUsunJButton;
    private javax.swing.JButton obiektyWybierzObiektJButton;
    private javax.swing.JButton oddzialyDodajJButton;
    private javax.swing.JTextField oddzialyIdOddzialuJTextField;
    private javax.swing.JTextField oddzialyIdOddzialuJTextField1;
    private javax.swing.JPanel oddzialyJPanel;
    private javax.swing.JTextField oddzialyNazwaOddzialuJTextField;
    private javax.swing.JComboBox oddzialySpecjalizacjaJComboBox;
    private javax.swing.JButton oddzialyUsunJButton;
    private javax.swing.JButton oddzialyUsunJButton1;
    private javax.swing.JButton oddzialyWybierzOddzialJButton;
    private javax.swing.JButton oddzialyWybierzOddzialJButton1;
    private javax.swing.JButton podgladJButton1;
    private javax.swing.JPanel posilkiJPanel;
    private javax.swing.JPanel przepustkiJPanel;
    private javax.swing.JPanel sprzetJPanel;
    private javax.swing.JTextField ulicaJTextField;
    private javax.swing.JPanel wartaJPanel;
    private javax.swing.JPanel zoldJPanel;
    private javax.swing.JButton zolnierzeDodajJButton;
    private javax.swing.JTextField zolnierzeEmailJTextField;
    private javax.swing.JTextField zolnierzeIdOddzialJText;
    private javax.swing.JTextField zolnierzeIdZolnierzaJTextField;
    private javax.swing.JTextField zolnierzeImieJTextField;
    private javax.swing.JPanel zolnierzeJPanel;
    private javax.swing.JTextField zolnierzeKodPocztowyJTextField;
    private javax.swing.JTextField zolnierzeMiastoJTextField;
    private javax.swing.JTextField zolnierzeNazwiskoJTextField;
    private javax.swing.JTextField zolnierzeNrDomuJTextField;
    private javax.swing.JTextField zolnierzeNrMieszkaniaJTextField;
    private javax.swing.JTextField zolnierzeNrTelefonuJTextField;
    private javax.swing.JTextField zolnierzePeselJTextField;
    private javax.swing.JButton zolnierzePodgladJButton;
    private javax.swing.JTextField zolnierzeUlicaJTextField;
    private javax.swing.JButton zolnierzeUsunJButton;
    private javax.swing.JButton zolnierzeWybierzOddzialJButton;
    private javax.swing.JButton zolnierzeWybierzZolnierzaJButton1;
    // End of variables declaration//GEN-END:variables
}
